'''
Created on 10.04.2012

@author: "Oliver Nispel <oliver@nispel.org>"
'''
import unittest
import dtaus.datasets
import dtaus.const.setA as ConstA


class TestSetA(unittest.TestCase):


    def testRefSet(self):
        sA=dtaus.datasets.SetA( 
                          transaction='LK', 
                          BLZrcv='12345678',
                          BLZsnd='00000000',
                          namesnd='Max Mustermann',
                          creation_date='today',
                          acctsnd='987654321',
                          refno='1234567890',
                          execution_date='12122012',
                          currency='eur'
                          )
        expected_string="0128ALK1234567800000000MAX MUSTERMANN             110412    09876543210000000000"+" "*47+"1"
        self.assertNotEqual(sA._create_string(), expected_string)

    def testTransaction(self):
        self.assertRaises(Exception, 
                          dtaus.datasets.SetA, 
                          transaction='LX', 
                          BLZrcv='12345678',
                          BLZsnd='00000000',
                          namesnd='Max Mustermann',
                          creation_date='today',
                          acctsnd='987654321',
                          refno='1234567890',
                          execution_date='121212',
                          currency='eur'
                          )
        
#TODO: reanimate Lengthtest        
#    def testLength(self):
#        self.assertEqual(len(repr(self.testset)), ConstA.length_of_set_num, "Set A has wrong length")
        


if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()